home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / dm3_src.zip / DMDATA.C < prev    next >
Text File  |  1990-04-07  |  23KB  |  381 lines

  1.  
  2. /* ************************************************************************* */
  3. /*                                                                           */
  4. /*                D O O R W A R E   D A T A   L I B R A R Y                  */
  5. /*                                                                           */
  6. /*                            For Mycrosoft C                                */
  7. /*                                                                           */
  8. /* ************************************************************************* */
  9.  
  10.  
  11.  
  12. /* ************************************************************************* */
  13. /*                            PROGRAM HISTORY                                */
  14. /* ************************************************************************* */
  15. /* 06/20/87     Version 1.00                                                 */
  16. /*                                                                           */
  17. /*                                                                           */
  18. /*                                                                           */
  19. /*                                                                           */
  20. /* ************************************************************************* */
  21.  
  22.  
  23. #include "dmcfg.h"                              /* Std defines & includes    */
  24.  
  25.  
  26. /*
  27.  *
  28.  * Definitions
  29.  *
  30.  */
  31.  
  32. #define DAY_SECONDS     86400L
  33.  
  34. #define BLACK           0x00
  35. #define BLUE            0x01
  36. #define GREEN           0x02
  37. #define CYAN            0x03
  38. #define RED             0x04
  39. #define MAGENTA         0x05
  40. #define BROWN           0x06
  41. #define LIGHT_GREY      0x07
  42. #define DARK_GREY       0x08
  43. #define LIGHT_BLUE      0x09
  44. #define LIGHT_GREEN     0x0a
  45. #define LIGHT_CYAN      0x0b
  46. #define LIGHT_RED       0x0c
  47. #define LIGHT_MAGENTA   0x0d
  48. #define YELLOW          0x0e
  49. #define WHITE           0x0f
  50.  
  51.  
  52. struct  bbs_node                                /* NODE INFORMATION          */
  53. {
  54.    char name[31];                               /* Last users name           */
  55.    char sysop_avail[2];                         /* SysOp available flag      */
  56.    char sysop_annoy[2];                         /* SysOp annoy flag          */
  57.    char sysop_next[2];                          /* SysOp next on system flag */
  58.    char line_printer[2];                        /* Line printer avail flag   */
  59.    char doors_avail[2];                         /* DOORS available flag      */
  60.    char eight_bits[2];                          /* Eight bit transmit flag   */
  61.    char baud_rate[2];                           /* Baud rate                 */
  62.    char upper_case[2];                          /* Upper case only flag      */
  63.    char reserve_1[5];                           /* Reserved                  */
  64.    char graphics_type[2];                       /* Graphics type flag        */
  65.    char sysop[2];                               /* User is SysOp flag        */
  66.    char active[1];                              /* Activity flag             */
  67.    char snoop[2];                               /* Snoop indicator           */
  68.    char baud_dial[2];                           /* Dialed in baud rate       */
  69.    char reserved_2[2];                          /* Reserved                  */
  70.    char login_time[6];                          /* Time logged onto system   */
  71.    char reserved_3[2];                          /* Reserved                  */
  72.    char private_door[2];                        /* Access to private DOOR    */
  73.    char transfer[2];                            /* Transfer function         */
  74.    char daily_exit_date[10];                    /* Last daily exit date      */
  75.    char daily_exit_time[5];                     /* Last daily exit time      */
  76.    char reliable[2];                            /* Reliable mode             */
  77.    char reserved_4[36];                         /* Reserved                  */
  78. };
  79.  
  80. struct  bbs_options                             /* USER OPTION INFORMATION   */
  81. {
  82.    int  logins;                                 /* Times logged on           */
  83.    int  last_msg;                               /* Last message read         */
  84.    char protocol[1];                            /* Transfer protocol         */
  85.    char graphics[1];                            /* Graphics mode             */
  86.    int  margins;                                /* Margin size               */
  87.    int  bit_flags;                              /* Access options            */
  88.    int  subscription;                           /* Date subscription started */
  89.    char page_length;                            /* Page length (binary)      */
  90.    char reserved[1];                            /* Reserved                  */
  91. };
  92.  
  93. #define BBS_OPTION_BIT_15       0x8000
  94. #define BBS_OPTION_BIT_14       0x4000
  95. #define BBS_OPTION_BIT_13       0x2000
  96. #define BBS_OPTION_BIT_12       0x1000
  97. #define BBS_OPTION_BIT_11       0x0800
  98. #define BBS_OPTION_BIT_10       0x0400
  99. #define BBS_OPTION_BIT_9        0x0200
  100. #define BBS_OPTION_QUESTIONARE  0x0100
  101. #define BBS_OPTION_AUTODOWN     0x0080
  102. #define BBS_OPTION_FILES        0x0040
  103. #define BBS_OPTION_BULLETINS    0x0020
  104. #define BBS_OPTION_LF           0x0010
  105. #define BBS_OPTION_CASE         0x0008
  106. #define BBS_OPTION_NULLS        0x0004
  107. #define BBS_OPTION_EXPERT       0x0002
  108. #define BBS_OPTION_BELL         0x0001
  109.  
  110. struct  bbs_user                                /* USER INFORMATION          */
  111. {
  112.    char name[31];                               /* Users name                */
  113.    char password[15];                           /* Users password            */
  114.    int  security;                               /* Security level            */
  115.    struct bbs_options options;                  /* User options              */
  116.    char residence[24];                          /* City and state            */
  117.    char reserved[19];                           /* Reserved                  */
  118.    char last_on[14];                            /* Date & time last on       */
  119.    char last_dir[3];                            /* Date last listed directory*/
  120.    int  downloads;                              /* Total downloads           */
  121.    int  uploads;                                /* Total uploads             */
  122.    int  elapsed;                                /* Elapsed time user was on  */
  123. };
  124.  
  125.  
  126. /* RBBS 16 user information                                                  */
  127.    /* Line  1 --> Name of RBBS system                                        */
  128.    /* Line  2 --> SysOps first name                                          */
  129.    /* Line  3 --> SysOps last name                                           */
  130.    /* Line  4 --> Comm port name                                             */
  131.    /* Line  5 --> Comm port parameters                                       */
  132.    /* Line  6 --> Network type                                               */
  133.    /* Line  7 --> Users first name                                           */
  134.    /* Line  8 --> Users last name                                            */
  135.    /* Line  9 --> Users city/state                                           */
  136.    /* Line 10 --> Graphics                                                   */
  137.    /* Line 11 --> Security level                                             */
  138.    /* Line 12 --> Time remaining in minutes                                  */
  139.  
  140.  
  141. struct  pcbbs_data                              /* PC-BOARD 12.1 INFORMATION */
  142. {
  143.    char display[2];                             /* Display On/Off (-1/0)     */
  144.    char printer[2];                             /* Printer On/Off (-1/0)     */
  145.    char page_bell[2];                           /* Page Bell On/Off (-1/0)   */
  146.    char caller_alarm[2];                        /* Caller Alarm On/Off (-1/0)*/
  147.    char sysop_next[2];                          /* Sysop Next-On Flag        */
  148.    char bps[4];                                 /* CONNECT bps rate of caller*/
  149.    char name[27];                               /* Name of caller plus 2 spcs*/
  150.    char first[15];                              /* Callers first name padded */
  151.    char graphics[2];                            /* Graphics Mode (-1/0)      */
  152.    char password[12];                           /* Password of caller        */
  153.    int  user_index;                             /* User's Record # in DBase  */
  154.    long connect_time;                           /* Time logged on in seconds */
  155.    long max_time;                               /* Allowed time in seconds   */
  156.    long door_time;                              /* Time Exited to DOOR in sec*/
  157.    char logon[5];                               /* Time logged on (hh:mm)    */
  158.    int  conference;                             /* Confer. exited to DOS from*/
  159.    int  conf_flags;                             /* Conf. 1-9 "joined flags"  */
  160.    int  conf_time;                              /* Conference Time Add       */
  161.    char dload_limit[8];                         /* Daily Download Byte Limit */
  162.    int  uload_credit;                           /* Upload time credit        */
  163.    char language[4];                            /* Language beging used      */
  164.    char ecr_modem[2];                           /* Error Corr. Modem (-1/0)  */
  165.    char chat;                                   /* Last Node CHAT Flag Status*/
  166. };
  167.  
  168.  
  169. struct  pcbbs2_data                             /* PC-BOARD 14.0 INFORMATION */
  170. {
  171.    char display[2];                             /* Display On/Off (-1/0)     */
  172.    char printer[2];                             /* Printer On/Off (-1/0)     */
  173.    char page_bell[2];                           /* Page Bell On/Off (-1/0)   */
  174.    char caller_alarm[2];                        /* Caller Alarm On/Off (-1/0)*/
  175.    char sysop_next;                             /* Sysop Next-On Flag        */
  176.    char ecr_modem[2];                           /* Error Corr. Modem (-1/0)  */
  177.    char graphics;                               /* Graphics Mode (1/0)       */
  178.    char chat;                                   /* Last Node CHAT Flag Status*/
  179.    char bps_open[5];                            /* OPEN bps rate of caller   */
  180.    char bps[5];                                 /* CONNECT bps rate of caller*/
  181.    int  user_index;                             /* User's Record # in DBase  */
  182.    char first[15];                              /* Callers first name padded */
  183.    char password[12];                           /* Password of caller        */
  184.    long connect_time;                           /* Time logged on in secs    */
  185.    char logon[5];                               /* Time logged on (hh:mm)    */
  186.    int  max_time;                               /* Daily time limit in mins  */
  187.    int  dload_limit;                            /* Daily Download Byte Limit */
  188.    char conference;                             /* Confer. exited to DOS from*/
  189.    char conf_flags[5];                          /* Conf. 1-9 "joined flags"  */
  190.    char conf_scans[5];                          /* Conf. 1-9 "scanned flags" */
  191.    int  conf_time;                              /* Conference Time Add       */
  192.    int  uload_credit;                           /* Upload time credit        */
  193.    char language[4];                            /* Language beging used      */
  194.    char name[25];                               /* Name of caller plus 2 spcs*/
  195.    int  time_left;                              /* Session time remaining    */
  196.    char node;                                   /* Node id                   */
  197.    char event_time[5];                          /* Next event time           */
  198.    char event_flag[2];                          /* Event active flag         */
  199.    char event_move[2];                          /* Delay event till logoff?  */
  200.    long msg_memory;                             /* Memorized message number  */
  201.    char comm_port;                              /* Comm port number          */
  202.    char reserved[2];                            /* Reserved for future use   */
  203. };
  204.  
  205.  
  206. /* Wildcat user information                                                  */
  207.    /* Line  1 --> User name                                                  */
  208.    /* Line  2 --> baud rate 0=2400,1=300,2=1200,3=9600                       */
  209.    /* Line  3 --> User city and state                                        */
  210.    /* Line  4 --> User Access level                                          */
  211.    /* Line  5 --> Logon time left in minutes                                 */
  212.    /* Line  6 --> Either COLOR or MONO user setting                          */
  213.    /* Line  7 --> User password                                              */
  214.    /* Line  8 --> User Record number                                         */
  215.    /* Line  9 --> Total minutes lon on bbs                                   */
  216.    /* Line 10 --> Time entered door hh:mm                                    */
  217.    /* Line 11 --> Time called bbs hh:mm                                      */
  218.    /* Line 12 --> User confernces join                                       */
  219.    /* Line 13 --> User daily d/l total                                       */
  220.    /* Line 14 --> User max d/l per day                                       */
  221.    /* Line 15 --> User daily d/l no of bytes in k                            */
  222.    /* Line 16 --> User max d/l in k                                          */
  223.    /* Line 17 --> User phone number                                          */
  224.    /* Line 18 --> Time / date last call                                      */
  225.    /* Line 19 --> Either NOVICE or EXPERT - user mode                        */
  226.    /* Line 20 --> N=none, X=Xmodem, C=Xmodem/crc etc                         */
  227.    /* Line 21 --> Last new file search MM/DD/YY                              */
  228.    /* Line 22 --> User total number of call                                  */
  229.    /* Line 23 --> User line per page or screen                               */
  230.    /* Line 24 --> Last msg no read                                           */
  231.    /* Line 25 --> User total u/l since first log-on                          */
  232.    /* Line 26 --> User total d/l since first log-on                          */
  233.    /* Line 27 --> Either 7  {Databits} or 8  {Databits}                      */
  234.    /* Line 28 --> Either LOCAL or REMOTE                                     */
  235.  
  236.  
  237. /* GAP BBS user information                                                  */
  238.      /* Line  1 --> Comm port (COM0 = local)                                 */
  239.      /* Line  2 --> baud rate 300 - 3800                                     */
  240.      /* Line  3 --> Parity 7 - 8                                             */
  241.      /* Line  4 --> Node number 1 - 99                                       */
  242.      /* Line  5 --> Host modem locked flag Y - N                             */
  243.      /* Line  6 --> Screen display Y - N                                     */
  244.      /* Line  7 --> Printer toggle Y - N                                     */
  245.      /* Line  8 --> Page bell Y - N                                          */
  246.      /* Line  9 --> Caller alarm Y - N                                       */
  247.      /* Line 10 --> User full name                                           */
  248.      /* Line 11 --> User city and state                                      */
  249.      /* Line 12 --> Home phone number                                        */
  250.      /* Line 13 --> Work/data phone number                                   */
  251.      /* Line 14 --> User password                                            */
  252.      /* Line 15 --> User security level                                      */
  253.      /* Line 16 --> Total times on BBS                                       */
  254.      /* Line 17 --> Last date user called BBS                                */
  255.      /* Line 18 --> Seconds remaining this call                              */
  256.      /* Line 19 --> Minutes remaining this call                              */
  257.      /* Line 20 --> Graphics mode GR, NG, 7E                                 */
  258.      /* Line 21 --> Page length                                              */
  259.      /* Line 22 --> User expert flag Y - N                                   */
  260.      /* Line 23 --> Conferences registered in                                */
  261.      /* Line 24 --> Conference exited door from                              */
  262.      /* Line 25 --> User expiration date                                     */
  263.      /* Line 26 --> Users file record number                                 */
  264.      /* Line 27 --> Default xfer protocol                                    */
  265.      /* Line 28 --> Total uploads                                            */
  266.      /* Line 29 --> Total downloads                                          */
  267.      /* Line 30 --> Daily download K total                                   */
  268.      /* Line 31 --> Daily download max K                                     */
  269.  
  270.  
  271. /* WWIV user information                                                     */
  272.    /* Line  1 --> User number                                                */
  273.    /* Line  2 --> Users alias                                                */
  274.    /* Line  3 --> Users real name                                            */
  275.    /* Line  4 --> Amateur radio callsign                                     */
  276.    /* Line  5 --> Age                                                        */
  277.    /* Line  6 --> Sex (M/F)                                                  */
  278.    /* Line  7 --> Gold (game credits)                                        */
  279.    /* Line  8 --> Last date on BBS                                           */
  280.    /* Line  9 --> Width of screen                                            */
  281.    /* Line 10 --> Lines in screen                                            */
  282.    /* Line 11 --> Security level                                             */
  283.    /* Line 12 --> SysOp flag                                                 */
  284.    /* Line 13 --> Co-SysOp flag                                              */
  285.    /* Line 14 --> ANSI graphics flag                                         */
  286.    /* Line 15 --> Remote user flag                                           */
  287.    /* Line 16 --> Time remaining in seconds (float)                          */
  288.    /* Line 17 --> General text file directory                                */
  289.    /* Line 18 --> Data file directory                                        */
  290.    /* Line 19 --> Path/Filename for text sysop log                           */
  291.    /* Line 20 --> Current baud rate (KB = local)                             */
  292.    /* Line 21 --> Comm port number                                           */
  293.  
  294.  
  295. struct  bbs_access                              /* TIME OPTION INFORMATION   */
  296. {
  297.    long start_time;                             /* Start of game period      */
  298.    int  levels[8];                              /* Play times per level      */
  299. };
  300.  
  301.  
  302. struct  bbs_time                                /* TIME OPTION INFORMATION   */
  303. {
  304.    long sysop_start;                            /* SysOp starting time       */
  305.    long sysop_stop;                             /* SysOp ending time         */
  306.    int  levels[8];                              /* Security levels           */
  307.    int  dayt[8];                                /* Daily time limits         */
  308.    int  dayg[8];                                /* Daily game limits         */
  309.    int  wait[8];                                /* Time between games        */
  310.    struct bbs_access    access[8];              /* Times for play            */
  311. };
  312.  
  313.  
  314. /*
  315.  *
  316.  * Global Data Section
  317.  *
  318.  */
  319.  
  320.  
  321. /* Remote User Data */
  322.  
  323. FILE    *remote_io;                             /* Comm port stream          */
  324. int     remote_user = 0;                        /* Comm port number          */
  325.  
  326.  
  327. /* BBS Data */
  328.  
  329. int     bbs_active = 0;                         /* BBS active                */
  330. char    bbs_dir[80];                            /* BBS home directory        */
  331.  
  332. struct  bbs_node        bbs_node_info;          /* BBS node information      */
  333. struct  bbs_user        bbs_user_info;          /* BBS user information      */
  334. struct  pcbbs_data      pcbbs_user_info;        /* PCB12.1 user information  */
  335. struct  pcbbs2_data     pcbbs2_user_info;       /* PCB14.0 user information  */
  336. char    ascii_user_info[35][128];               /* Wildcat user information  */
  337. struct  bbs_time        bbs_time_info;          /* BBS door access times     */
  338.  
  339.  
  340. /* Monitor Data */
  341.  
  342. FILE    *mon_inp;                               /* Input parameters          */
  343. FILE    *mon_out;                               /* Output parameters         */
  344. int     mon_active = 0;                         /* Monitor active            */
  345.  
  346. long    mon_signoff;                            /* time to signoff at        */
  347. int     mon_user = -1;                          /* monitor user #            */
  348. int     mon_points = 0;                         /* current player score      */
  349. int     mon_max_play = 30;                      /* time to play in mins      */
  350. int     mon_nulls = 0;                          /* number of nulls required  */
  351. int     mon_graphics = 0;                       /* monitor graphics flag     */
  352. char    mon_dir[40] = {"\0"};                   /* monitor subdirectory      */
  353. char    mon_sound[40] = {"Y"};                  /* monitor sound flag        */
  354.  
  355.  
  356. /* User Data */
  357.  
  358. int     user_node      = 0;                     /* current node              */
  359. char    user_name[32];                          /* users name                */
  360. char    user_game_date[12] = {"Jan 01 1900"};   /* last day user player      */
  361. long    user_game_end;                          /* last time user played     */
  362. long    user_day_time  = 0L;                    /* time user played          */
  363. int     user_day_games = 0;                     /* games user played         */
  364. long    user_start     = 0L;                    /* time user started game    */
  365. long    user_signon    = 0L;                    /* time user signed on       */
  366. long    user_signoff   = 0L;                    /* time to signoff at        */
  367. int     user_points    = 0;                     /* current player score      */
  368. int     user_security  = 0;                     /* user security level       */
  369. int     user_nulls     = 0;                     /* number of nulls required  */
  370. int     user_graphics  = 0;                     /* graphics flag             */
  371. int     user_caps      = 0;                     /* caps only flag            */
  372. int     user_page      = 22;                    /* user page length          */
  373. int     user_access_level = -1;                 /* user game access level    */
  374.  
  375.  
  376. /* Global Buffers & Flags */
  377.  
  378. char    dminbuff[1024];                         /* Line buffer               */
  379. char    dmoutbuff[512];                         /* Line buffer               */
  380.  
  381.